Skip to content

zThrown work#733

Open
joeyballentine wants to merge 1 commit into
bfbbdecomp:mainfrom
joeyballentine:zthrown-almost-100
Open

zThrown work#733
joeyballentine wants to merge 1 commit into
bfbbdecomp:mainfrom
joeyballentine:zthrown-almost-100

Conversation

@joeyballentine
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

main/SB/Game/zThrown

Section From To Bytes
.bss 0.00% 100.00% +13440
📈 .data 0.00% 82.74% +834
📈 .rodata 0.00% 95.08% +410
.sdata2 26.92% 100.00% +64
📈 .text 10.93% 94.22% +9714
Function From To Bytes
📈 zThrown_Setup(zScene*) 19.19% 89.30% +302
📈 zFruit_ColorFade(zThrownStruct*) 0.00% 97.31% +140
📈 zFruit_Update(xEnt*, xScene*, float) 0.00% 97.85% +755
📈 zThrown_Update(xEnt*, xScene*, float) 0.00% 88.51% +3349
xBBox::operator=(const xBBox&) 0.00% 100.00% +76
zThrown_Reset() 0.00% 100.00% +168
📈 zThrown_LaunchVel(xEnt*, xVec3*) 0.00% 91.93% +389
📈 zThrown_LaunchDir(xEnt*, xVec3*) 0.00% 99.98% +175
📈 zThrown_LaunchPos(xEnt*, xVec3*, xVec3*) 0.00% 94.20% +471
📈 zThrown_LaunchStack(xEnt*, xEnt*) 0.00% 95.41% +343
📈 zThrown_AddFruit(xEnt*) 0.00% 90.04% +388
📈 zThrown_Remove(xEnt*) 14.14% 99.95% +370
📈 zThrownCollide_CauseDamage(zThrownStruct*, xEntCollis*) 0.00% 92.12% +512
📈 zThrownCollide_ThrowFruit(zThrownStruct*, xEntCollis*, float*, float*) 0.00% 99.55% +967
📈 zThrownCollide_StoneTiki(zThrownStruct*, xEntCollis*, float*, float*) 0.00% 99.44% +350
zThrown_IsFruit(xEnt*, float*) 75.67% 100.00% +29
zThrown_ButtonIteratorCB(xBase*, zScene*, void*) 0.00% 100.00% +92
zThrownStruct::operator=(const zThrownStruct&) 0.00% 100.00% +216
xEntFrame::operator=(const xEntFrame&) 0.00% 100.00% +272
xEntDrive::operator=(const xEntDrive&) 0.00% 100.00% +244
xEntDrive::tri_data::operator=(const xEntDrive::tri_data&) 0.00% 100.00% +100

@joeyballentine
Copy link
Copy Markdown
Collaborator Author

Decided to reopen this

@github-actions
Copy link
Copy Markdown

main/SB/Game/zThrown

Section From To Bytes
.bss 0.00% 100.00% +13440
📈 .data 0.00% 82.74% +834
📈 .rodata 0.00% 95.08% +410
.sdata2 26.92% 100.00% +64
📈 .text 10.93% 94.22% +9714
Function From To Bytes
📈 zThrown_Setup(zScene*) 19.19% 89.30% +302
📈 zFruit_ColorFade(zThrownStruct*) 0.00% 97.31% +140
📈 zFruit_Update(xEnt*, xScene*, float) 0.00% 97.85% +755
📈 zThrown_Update(xEnt*, xScene*, float) 0.00% 88.51% +3349
xBBox::operator=(const xBBox&) 0.00% 100.00% +76
zThrown_Reset() 0.00% 100.00% +168
📈 zThrown_LaunchVel(xEnt*, xVec3*) 0.00% 91.93% +389
📈 zThrown_LaunchDir(xEnt*, xVec3*) 0.00% 99.98% +175
📈 zThrown_LaunchPos(xEnt*, xVec3*, xVec3*) 0.00% 94.20% +471
📈 zThrown_LaunchStack(xEnt*, xEnt*) 0.00% 95.41% +343
📈 zThrown_AddFruit(xEnt*) 0.00% 90.04% +388
📈 zThrown_Remove(xEnt*) 14.14% 99.95% +370
📈 zThrownCollide_CauseDamage(zThrownStruct*, xEntCollis*) 0.00% 92.12% +512
📈 zThrownCollide_ThrowFruit(zThrownStruct*, xEntCollis*, float*, float*) 0.00% 99.55% +967
📈 zThrownCollide_StoneTiki(zThrownStruct*, xEntCollis*, float*, float*) 0.00% 99.44% +350
zThrown_IsFruit(xEnt*, float*) 75.67% 100.00% +29
zThrown_ButtonIteratorCB(xBase*, zScene*, void*) 0.00% 100.00% +92
zThrownStruct::operator=(const zThrownStruct&) 0.00% 100.00% +216
xEntFrame::operator=(const xEntFrame&) 0.00% 100.00% +272
xEntDrive::operator=(const xEntDrive&) 0.00% 100.00% +244
xEntDrive::tri_data::operator=(const xEntDrive::tri_data&) 0.00% 100.00% +100

main/dolphin/src/os/init/__start

Section From To Bytes
.text 100.00% 100.00% +/-0
Function From To Bytes
__check_pad3 0.00% 100.00% +64
__set_debug_bba 0.00% 100.00% +12
__get_debug_bba 0.00% 100.00% +8
__start 0.00% 100.00% +348
__init_registers 0.00% 100.00% +144
__init_data 0.00% 100.00% +192

main/dolphin/src/os/init/__ppc_eabi_init

Section From To Bytes
.text 100.00% 100.00% +/-0
Function From To Bytes
__init_hardware 0.00% 100.00% +36
__flush_cache 0.00% 100.00% +52

main/debugger/embedded/MetroTRK/Portable/serpoll

Section From To Bytes
.bss 83.33% 100.00% +3
Function From To Bytes

main/Runtime/__mem

Section From To Bytes
Function From To Bytes
memset 0.00% 100.00% +48
__fill_mem 0.00% 100.00% +184
memcpy 0.00% 100.00% +80

main/debugger/embedded/MetroTRK/Portable/mem_TRK

Section From To Bytes
.text 100.00% 100.00% +/-0
Function From To Bytes
TRK_memset 0.00% 100.00% +48
TRK_memcpy 0.00% 100.00% +36

main/debugger/embedded/MetroTRK/Processor/ppc/Generic/targimpl

Section From To Bytes
.bss 99.86% 100.00% +2
Function From To Bytes

main/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk

Section From To Bytes
⚠️ .text 85.35% 51.14% --217
Function From To Bytes
📈 __TRK_reset 0.00% 10.84% +31

main/debugger/embedded/MetroTRK/Os/dolphin/dolphin_trk_glue

Section From To Bytes
.bss 99.82% 100.00% +16
Function From To Bytes

Copy link
Copy Markdown
Member

@SquareMan SquareMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was your AI use here? It looks to me like at least some of the functions are AI generated so I'd just like to know if it's only some of them or if it's entirely AI for my own understanding of the AI's abilities here.

Comment thread src/SB/Core/x/xEnt.h
Comment on lines +83 to +89
xEntFrame& operator=(const xEntFrame& rhs)
{
mat = rhs.mat;
oldmat = rhs.oldmat;
*(S32*)(&oldvel.x) = *(S32*)(&rhs.oldvel.x);
*(S32*)(&oldvel.y) = *(S32*)(&rhs.oldvel.y);
*(S32*)(&oldvel.z) = *(S32*)(&rhs.oldvel.z);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is probably a compiler generated assignment function. That's the only way I know to get it to copy floats via the regular registers. Do things work ok if you delete this function?

Comment thread src/SB/Core/x/xEntDrive.h
Comment on lines +15 to +20
tri_data& operator=(const tri_data& rhs)
{
xCollis::tri_data::operator=(rhs);
*(S32*)(&loc.x) = *(S32*)(&rhs.loc.x);
*(S32*)(&loc.y) = *(S32*)(&rhs.loc.y);
*(S32*)(&loc.z) = *(S32*)(&rhs.loc.z);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Comment thread src/SB/Core/x/xEntDrive.h
Comment on lines +46 to +59
xEntDrive& operator=(const xEntDrive& rhs)
{
flags = rhs.flags;
otm = rhs.otm;
otmr = rhs.otmr;
os = rhs.os;
tm = rhs.tm;
tmr = rhs.tmr;
s = rhs.s;
odriver = rhs.odriver;
driver = rhs.driver;
driven = rhs.driven;
*(S32*)(&op.x) = *(S32*)(&rhs.op.x);
*(S32*)(&op.y) = *(S32*)(&rhs.op.y);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Comment thread src/SB/Core/x/xMath3.h
Comment on lines +69 to +72
xBBox& operator=(const xBBox& rhs)
{
*(S32*)(&center.x) = *(S32*)(&rhs.center.x);
*(S32*)(&center.y) = *(S32*)(&rhs.center.y);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Comment thread src/SB/Game/zThrown.h
Comment on lines +55 to +62
zThrownStruct& operator=(const zThrownStruct& rhs)
{
ent = rhs.ent;
stackEnt = rhs.stackEnt;
stackTgt = rhs.stackTgt;
patLauncher = rhs.patLauncher;
oldupdate = rhs.oldupdate;
*(S32*)(&vel.x) = *(S32*)(&rhs.vel.x);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

Comment thread src/SB/Game/zThrown.cpp
Comment on lines +131 to +132
if (((xEnt*)sc->base[i])->baseType == eBaseTypeStatic ||
((xEnt*)sc->base[i])->baseType == eBaseTypeDestructObj)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

going off memory here so ignore me if I'm wrong but isn't baseType accessible from the base type without casting here?

Comment thread src/SB/Game/zThrown.cpp
Comment on lines +271 to +278
// Call shrapnel init if exists
{
zShrapnelAsset* shrap = thrown->stats->shrapAsset;
if (shrap != NULL && shrap->initCB != NULL)
{
shrap->initCB(shrap, ent->model, NULL, NULL);
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a need for this extra outer scope here?

Comment thread src/SB/Game/zThrown.cpp
Comment on lines +376 to +379
// Set up temp collision struct
xEntCollis collis;
collis.chk = 0x2E;
collis.pen = 0x2E;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this function AI generated? Comments like this are super weird. Anyways, I think these are supposed to use the collision type flag macros in xEnt.h. 0x2E would be XENT_COLLTYPE_ENV | XENT_COLLTYPE_NPC | XENT_COLLTYPE_DYN | XENT_COLLTYPE_STAT.

Comment thread src/SB/Game/zThrown.cpp

switch (stackTgt->bound.type)
{
case 1: // sphere
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are XBOUND_TYPE macros in xBound.h for these cases

Comment thread src/SB/Game/zThrown.cpp
Comment on lines +1144 to +1155
// Clear thrown flag from baseFlags
ent->baseFlags &= (U16)~0x80;

// Clear frame if it was our temp frame
if (thrown->ent->frame == &thrown->frame)
{
thrown->ent->frame = NULL;
}

// Zero out model color multipliers
xModelInstance* mod = thrown->ent->model;
mod->RedMultiplier = mod->GreenMultiplier = mod->BlueMultiplier = 0.0f;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More super unnecessary comments in this function after this one. Makes me question if potentially useful comments like this one are accurate. However of course the correct action is to use a bitflag macro value here instead of a literal int but I'm not sure if baseFlags has any defined yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants